﻿using Microsoft.Practices.Unity.InterceptionExtension;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YouTravel.InterceptionBehavior
{
    public class ExceptionLoggingBehavior : IInterceptionBehavior
    {
        public IEnumerable<Type> GetRequiredInterfaces()
        {
            return Type.EmptyTypes;
        }

        public IMethodReturn Invoke(IMethodInvocation input, GetNextInterceptionBehaviorDelegate getNext)
        {
            foreach (var item in input.Arguments)
            {

            }
            var result = getNext().Invoke(input, getNext);
            if (result.Exception != null)
            {

            }
            return result;
        }

        public bool WillExecute
        {
            get { return true; }
        }
    }
}
